package com.imay.live.adapter.family;

import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.imay.live.R;
import com.imay.live.model.FamilyModel;
import com.imay.live.utils.GlideUtil;

/**
 * 家族的推荐列表的Adapter
 * Created by chan on 2017/5/2.
 */

public class FamilySuggestAdapter extends BaseQuickAdapter<FamilyModel, BaseViewHolder> {
    public FamilySuggestAdapter() {
        super(R.layout.item_dynamics_suggest_family);
    }

    @Override
    protected void convert(BaseViewHolder helper, FamilyModel item) {
        // VIP的显示图标
        GlideUtil.loadCircleImage((ImageView) helper.getView(R.id.civ_item_dynamics_suggest_img), item.getUrl(), R.mipmap.placeholder);
        helper.setText(R.id.tv_family_level, Integer.toString(item.getLv()));
        helper.setText(R.id.tv_item_dynamics_suggest_name, item.getName());
        if (item.getCountFriends() > 0) {
            helper.setVisible(R.id.tv_item_dynamics_suggest_location, true);
            helper.setText(R.id.tv_item_dynamics_suggest_location, mContext.getString(R.string.str_family_suggest_count, item.getCountFriends()));
        } else {
            helper.setVisible(R.id.tv_item_dynamics_suggest_location, false);
        }
    }
}
